package org.exeed.controller;

import org.exeed.aop.tag.Auth;
import org.exeed.bean.ResultBean;
import org.exeed.dto.ModifyTO;
import org.exeed.dto.SignInTO;
import org.exeed.dto.TokenTO;
import org.exeed.entity.SysEntity;
import org.exeed.service.SysService;
import org.exeed.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RequestMapping("/sys")
@RestController
public class SysController {

    @Autowired
    private UserService userService;

    @Autowired
    private SysService sysService;


    @Auth
    @GetMapping("/selectSysSetting")
    public ResultBean selectSysSetting(){

        return ResultBean.succeed(sysService.selectOne());
    }

    @Auth
    @PostMapping("/updateSystemConfig")
    public ResultBean updateSystemConfig(@RequestBody SysEntity sysEntity){

        sysService.update(sysEntity);
        return ResultBean.succeed();
    }

}
